#ifndef PINNEDOBJECT_H_
#define PINNEDOBJECT_H_

#include "TextureManager.h"
#include "Object.h"
#include "Vector2D.h"

class PinnedObject: public Object
{
	private:
	Vector2D pinPoint;
	Vector2D boltBox[4];

	public:
	float AngleBetween(Vector2D pointObjectSpace, Vector2D pointWorldSpace);
	int LineCircleIntersect(Vector2D center, float radius, Vector2D edge[], Vector2D * result);
	void RotateToEdge(Vector2D vertex, Vector2D edge[], bool changeVelocity);
	void RotateToVertex(Vector2D vertex, Vector2D edge[], bool changeVelocity);
	void RotateToEdge(Vector2D vertex, Vector2D edge[]);
	void RotateToVertex(Vector2D vertex, Vector2D edge[]);
	virtual Vector2D VelocityAtPoint(Vector2D point);
	virtual void Draw();
	virtual bool PreThinkEntryPoint(double elapsedTime);
	virtual void CalculateMomentOfInertia();
	virtual void AddForce(Vector2D ray);
	virtual void AddForce(Force force);
	virtual void AddForce(Vector2D ray, Vector2D origin);
	virtual void AddForceObjectSpace(Vector2D ray, Vector2D origin);
	virtual void Rotate(float theta);
	virtual void Rotate(Vector2D radius, Vector2D delta);
	PinnedObject();
	PinnedObject( TextureManager * textureManager,
				  Material * material,
				  float textureRotation,
			Vector2D position, 
			Vector2D velocity,
			Vector2D acceleration,
			Vector2D * vertices,
			int numVertices,
			float rotation,
			float angularVelocity,
			float angularAcceleration,
			float mass,
			bool isPinned,
			Vector2D pinPoint);
	virtual ~PinnedObject();
};
#endif /*PINNEDOBJECT_H_*/
